<%--
  Created by IntelliJ IDEA.
  User: tugou
  Date: 2017/5/9
  Time: 22:31
  To change this template use File | Settings | File Templates.
--%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form" %>

<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page pageEncoding="UTF-8" %>
<html>
<head>
    <meta charset="UTF-8">
    <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no"
          name="viewport" id="viewport">
    <title>添加人员</title>
    <script src="<%=basePath%>js/jquery.min.js"></script>
    <script src="<%=basePath%>js/layer/layer.js"></script>
    <link rel="stylesheet" type="text/css" href="<%=basePath%>css/main.css">
    <script>
        function sumbit() {
            var mapperName = $("#mapperName").val();
            if (mapperName.length == 0) {
                showDialog("配置名称不能为空");
                return false;
            }
            var configName = $("#configName").val();
            if (configName.length == 0) {
                showDialog("配置字段不能为空");
                return false;
            }
            var configValue = $("#configValue").val();
            if (configValue.length == 0) {
                showDialog("请输入设定数值!");
                return false;
            }
             $("#addConfig").submit();
        }
        var msg = "${msg.errmsg}";
        if (msg != null && msg != "") {
            showDialog(msg);
        }
        function showDialog(msg) {
            layer.msg(msg, {
                time: 20000, //20s后自动关闭
                btn: ['确定']
            });
        }
    </script>
</head>
<body>
<header>

    <h1><a href="./index.html">报名学车管理后台</a></h1>

</header>
<div id="user_nav">
    <a href="<%=basePath%>sys/changePaw"><h1>${sysuser.userName}</h1></a>
    <h2>
        <c:if test="${sysuser.userType == 1}">
            系统管理员
        </c:if>
        <c:if test="${sysuser.userType == 2}">
            运营人员
        </c:if>
    </h2>
    <a href="<%=basePath%>admin/loginOut"><h3>退出</h3></a>
</div>
<div id="sidebar">
    <ul>
        <li><a href="<%=basePath%>sys/index/1"><i class="icon icon_home"></i><span>首页</span></a></li>
        <li><a href="<%=basePath%>sys/userList"><i class="icon icon_users"></i><span>人员管理</span></a></li>
        <li><a href="<%=basePath%>sys/getStudentList"><i
                class="icon icon_chapter"></i><span>学员信息管理</span></a></li>
        <li><a href="<%=basePath%>sys/examsPage"><i class="icon icon_exams"></i><span>学车点管理</span></a></li>
        <li class="active"><a href="<%=basePath%>sys/settingPage"><i class="icon icon_setting"></i><span>网站设置</span></a></li>
    </ul>
</div>
<div id="content">
    <div class="title_h1">
        <h1>网站配置</h1>
    </div>
    <div class="box_silde">
        <menu id="myTab1">
            <li class="active" onMouseOver="nTabs(this,0)" ;><em class="icon_user_add"></em>添加配置</li>
        </menu>
        <form action="<%=basePath%>sys/addSetting" id="addConfig" method="post">
            <input type="hidden" name="id" value="${sysConfig.id}">
            <div class="TabContent">
                <div id="myTab1_Content0">
                    <ul>
                        <li>
                            <label class="box_silde_label">配置名称：</label>
                            <input class="box_silde_controls" type="text" name="mapperName" value="${sysConfig.mapperName}"
                                   id="mapperName"/>
                            请输入配置名称(如：学车时间)
                        </li>
                        <li>
                            <label class="box_silde_label">配置字段：</label>
                            <input class="box_silde_controls" type="text" name="configName" id="configName" value="${sysConfig.configName}"/>
                            配置字段为后台识别
                        </li>
                        <li>
                            <label class="box_silde_label">设定数值：</label>
                            <input class="box_silde_controls" type="text" name="configValue" id="configValue" value="${sysConfig.configValue}"/>
                            设定配置对应的数值(如 4，为学车时间4天)
                        </li>
                    </ul>
                    <button type="button" class="btn_save" onclick="sumbit()">提交</button>
                </div>
            </div>
        </form>
    </div>
    <footer>© 2017 All Rights Reserved</footer>
</div>
</body>
</html>
